<header>
    <div id="header-buttons">
        <a href="javascript:history.go(-1);">
            <div id="back" class="header-menu-link" data-back="false">
            </div>
        </a>

        <!--<div id="messageLink" class="header-menu-link"><a href="{:U('w3g/Index/msgbox')}"><i class="num"></i></a></div>-->
        <div id="menuLink" class="header-menu-link"></div>
        <div id="otherLink">
            <a id="writeLink" class="header-menu-link" href="{:u('w3g/Index/sendmsg')}"></a>
        </div>
    </div>
    <h1 class="hasback">
        我的私信
    </h1>
</header>
<volist name="data" id="message">
    <div class="msglist-item ts-listen" data-listen="weibo-msgShowDetail-{$message.list_id}">
        <div class="pmedia m-i-header">
            <div class="pull-left m-i-h-avatar ts-listen">
                    <img src="
                    <php> if($message['last_message']['user_info']['uid'] == $mid){</php>
                            {$message['to_user_info'][$message['last_message']['to_uid'][0]]['avatar_small']}
                    <php>}elseif($message['last_message']['user_info']['uid'] != $mid){</php>
                            {$message['last_message']['user_info']['avatar_small']}
                    <php>}</php>
                    ">
            </div>
            <div class="media-body m-i-h-info">
                <div class="m-i-h-i-l-name">
                    <php> if($message['last_message']['user_info']['uid'] == $mid){</php>
                    <php>
                        $sendToUserInfo = getSubByKey($message['to_user_info'], 'uname');
                    </php>
                        {:L('PUBLIC_SENTTO')} {:implode('、', $sendToUserInfo)}：
                    <php>}else{</php>
                        {$message.last_message.user_info.uname}{:L('PUBLIC_SAY')}：
                        <php>}</php>
                    <!-- <span class="msg-time">
                        ({$message.list_ctime|friendlyDate})
                    </span> -->
                </div>
                <div class="m-i-h-i-l-description">
                    {$message.list_ctime|friendlyDate}

                </div>
            </div>
        </div>
        <div class="m-i-body">
            <p class="m-i-b-p">
                <php>echo wapFormatContent($message['last_message']['content']);</php>
            </p>
        </div>
    </div>
</volist>
<php>if($count > 20){</php>
<!-- 分页 -->
<div id="pager_box">
    <php>
        $p = empty($_GET['p']) ? $p=1 : $p = $_GET['p'];
        if(empty($_GET['p']) || $_GET['p']==1){
    </php>
            <a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none pure-button pure-button-disabled">上一页</a>
    <php>}else{</php>
            <a href="javascript:;" data-link="{:U('w3g/Message/index',array('p'=>$p-1))}" id="prev" class="pager_child pager_p_n pure-button pure-button-primary ts-listen" data-listen="weibo-pagerReplace-click" data-for="msg">上一页</a>
    <php>}</php>
     <select id="page_sel" class="pager_child pure-button ts-listen" data-listen="weibo-pagerReplace-change" data-for="msg">
        <php>
            $_GET['p']!=0?$get=$_GET['p']:$get=1;
            $_count = ceil($count/20);
            if($get<6){
                for($i=0;$i<($_count);$i++){
                    $get==$i+1?$selected='selected="selected"':$selected='';
                    if($i>9){
                        break;
                    }
        </php>
        <option value="{:U('w3g/Message/index')}&p={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
        <php>	}
            }elseif($get>=6){
                for($i=($get-5);$i<$get;$i++){
                    $get==$i+1?$selected='selected="selected"':$selected='';
        </php>
        <option value="{:U('w3g/Message/index')}&p={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
        <php>	}</php>
        <php>	for($i=$get;$i<($get+5);$i++){
                    $get==$i+1?$selected='selected="selected"':$selected='';
                    if($i>$_count-1){
                        break;
                    }
        </php>
        <option value="{:U('w3g/Message/index')}&p={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
        <php>	}</php>
        <php>}</php>

    </select>
        <php>if($_GET['p'] >= $tpage) {</php>
                <a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none pure-button pure-button-disabled">下一页</a>
        <php>}else{</php>
                <a href="javascript:;" data-link="{:U('w3g/Message/index',array('p'=>$p+1))}" id="next" class="pager_child pager_p_n pure-button pure-button-primary ts-listen" data-listen="weibo-pagerReplace-click" data-for="msg">下一页</a>
        <php>}</php>
</div>
<php>}</php>
<php>if(!empty($jumpUrl)){ echo '<script> window.location.href = "'.$jumpUrl.'"; </script>'; } </php>